<!doctype html>
<html><!-- InstanceBegin template="/Templates/biTemplate.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta charset="utf-8">
<meta id="viewport" name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0,user-scalable=no,target-densitydpi=300">
<!-- InstanceBeginEditable name="doctitle" -->
<title>推荐应用</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="EditRegion-jscode" -->
<link rel="stylesheet" type="text/css" href="res/common.css">
<script src="../resources/js/jquery-1.7.2.min.js"></script>

<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F883c1dc0c5cf74748ff6876f4606832f' type='text/javascript'%3E%3C/script%3E"));
</script>

<script type="text/javascript">

var jsonserver="http://bj.911860.com/mobile-html5-rest/";
function getQueryParameter(qs)  
{  
	var s = location.href;  
	s = s.replace("?","?&").split("&");//这样可以保证第一个参数也能分出来 
	var re = "";  
	for(i=1;i<s.length;i++)  
		if(s[i].indexOf(qs+"=")==0)  
			re = s[i].replace(qs+"=","");//取代前面的参数名，只剩下参数值  
			  
	return re;  
}  



function detectDeviceType(){
	var isIphone =navigator.userAgent.indexOf("iPhone") != -1;
	var isIpod = navigator.userAgent.indexOf("iPod") != -1 ;
	var isIpad = navigator.userAgent.indexOf("iPad") != -1 ;
	
	var isAndroid = navigator.userAgent.indexOf("Android") != -1 ;
	var isIos = isIphone || isIpod || isIpad ;
	return isIos?"Apple":"Android";
	//return "Apple";
} 

$(function(){
    addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); 
	addEventListener("orientationchange", function() { setTimeout(hideURLbar, 0); }, false);
	addEventListener("load",function(){$("#loading").hide();
	$(".floatBoxBg").hide();});
      function hideURLbar(){ 
               window.scrollTo(0,1); 
      }
      if(navigator.userAgent.toLowerCase().indexOf("android", 0)<0){
         $("#footer").css({"center;z-index":"999","position":"fixed","bottom":"0"});
         window.scrollTo(0,1); 
        }else{
        $("#footer").css({"position":"fixed","bottom":"0"});
		var top = $("#footer").offset().top;
		$(window).scroll(function(){
		$("#footer").offset({top:$(document).scrollTop()+top});
		});
       }

}); 

$(document).ready(function() {
if(detectDeviceType()=="Apple"){
		$("#viewport").attr("content","width=640,initial-scale=0.5, maximum-scale=0.5, minimum-scale=0.5,user-scalable=no");
	}
	//logincheck();
	$("#appDlAd").hide();
	$("#appDlAp").hide();
	$("body").attr("onresize","overhidden()");
	var url=jsonserver+"ra/relation/appid/"+getQueryParameter("appId")+"/limit/8";
	$.getJSON(url+".jsonp?callback=?",{},function(data){
		if(detectDeviceType()=="Android"){
		$("#appDlAd").show();
		$("#appNm").text(data.app_name);
		$("#size").text(data.app_mb);
		$("#dlHistory").text(data.app_downcount);
		$("#edition").text(data.version_num);
		$("#appPic").attr("src",data.logo_url);
		$("#free").text(data.is_limitfree);
		$("#app_det").text(data.app_desc);
		$("#app_det2").text(data.app_desc);
		$("#dlBtn").attr("href",data.download_url).click(function(){
			
			//记录应用下载点击
			var jilu=jsonserver+"util/appdown/appid/"+getQueryParameter("appId");
			$.getJSON(jilu+".jsonp?callback=?",{},function(data){
				
			});
				
			});

		}else{
			$("#appDlAp").show();
		$("#appNmAp").text(data.app_name);
		$("#appPicAp").attr("src",data.logo_url);
		$("#freeAp").text(data.is_limitfree);
		$("#app_det").text(data.app_desc);
		$("#app_det2").text(data.app_desc);
		$("#dlBtnAp").bind("click",function(){
			
			window.open(data.download_url);
			});
		$("#sizeAp").text(data.app_mb);	
		$("#source").text(data.app_firm);
		$("#releasedate").text(data.update_date);
		$("#editionAp").text(data.version_num);
		}
		$.each(data.sabList,function(i,field){
			var appdiv=$("<div>").addClass("reclist").click(function(){
						window.location.href=field.link;
					});
				$(field.appText).appendTo(appdiv);
				appdiv.appendTo($("#app_reco"));
			});
			$("#footer").hide();
	overhidden();
	$("#content2").append('<div class="woDiv" onclick="download()"><span style="color:#49494b;">下载智能云管家客户端</span><img src="res/img/downll.png" style="padding-top:15px;"/></div>');
	window.scrollTo(0,1);
		});
	//if(localStorage.getItem("width")==null){
	//	localStorage.setItem("width",window.screen.width);
	//	localStorage.setItem("height",window.screen.height);
	//}
	if(localStorage.getItem("width")>700) {
		$("meta").attr("content","width=device-width, initial-scale=0.6, minimum-scale=0.6, maximum-scale=0.6");
	}
	if(window.screen.height>window.screen.width){
		Vertical();
	}
	$( window ).bind( "resize", function() {
		changeScreen();
		});
});
function changeScreen(){
	if(window.screen.height>window.screen.width){
		Vertical();
		} 
	else {
		$("#content").removeAttr("style");
		$("#mainconfig").removeAttr("style");
	}
	}
function Vertical(){
	var screenheigh = localStorage.getItem("height");
	if(screenheigh<=500){
		$("#mainconfig").get(0).style.height="675px";
	}
	else if(screenheigh>1100){
		$("#mainconfig").get(0).style.height=0.84*screenheigh+"px";
	}
	else{
		$("#mainconfig").get(0).style.height=1.03*screenheigh+"px";
	}
	}
function uporDown(){
	if($("#updownFlag").val()=="0"){
			
			$("#app_det").removeClass("overflow");
			$("#openFlag").attr("src","../resources/css/images/Recommend/images/tj_up.png");
			$("#updownFlag").val("1");
		}else{
			$("#app_det").addClass("overflow");
			$("#openFlag").attr("src","../resources/css/images/Recommend/images/tj_down.png");
			$("#updownFlag").val("0");
			}
	}
function goto(appId){
	window.location.href="app-recommon.html?appId="+appId;
}
function getQueryParameter(qs)  
	{  
		var s = location.href;  
		s = s.replace("?","?&").split("&");//这样可以保证第一个参数也能分出来 
		var re = "";  
		for(i=1;i<s.length;i++)  
			if(s[i].indexOf(qs+"=")==0)  
				re = s[i].replace(qs+"=","");//取代前面的参数名，只剩下参数值  
				  
		return re;  
	}  
function overhidden(){
	var w=document.body.clientWidth;
	$(".apptitle").width(0.4*w+"px");
	$(".apptypefee").width("120px");
}

</script>
<style type="text/css">
.overflow{
	max-height:200px;
	overflow:hidden;
}
</style>
<link href="res/index/css/app.css" rel="stylesheet" type="text/css">
<!-- InstanceEndEditable -->
<style type="text/css">
*{
	font-family:Heiti SC;
	font-weight:600;
}
</style>
	<script type="text/javascript">
//var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
//document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F2284c04845acdcd94dd640a8555927dc' type='text/javascript'%3E%3C/script%3E"));
</script>

</head>
<link rel="icon" href="res/img/logo.png" type="image/x-icon">
<link rel="shortcut icon" href="res/img/logo.png" type="image/x-icon"> 
<body style="margin:0;">

	<div id="header">
	<!-- InstanceBeginEditable name="EditRegion-header" -->
    <table width="100%" height="88px">
    	<tr>
        	<td width="10%" onClick="javascript:location.href='index.html'">
            <div><img src="res/img/back.png"/></div>
            </td>
            <td width="80%">
            <span style="font-size:34px; font-weight:bold; color:#fff;">推荐应用</span>
            </td>
            <td width="10%">
            
            </td>
        </tr>
    </table>
	<!-- InstanceEndEditable -->
    </div>
    <div id="content">
    <div id="loading" class="loading"><img src="res/loading.gif"/>载入中...</div>
    <div class="floatBoxBg"></div>
	<!-- InstanceBeginEditable name="EditRegion-content" -->
      <div id="mainconfig">
    <div id="app">
    <div id="appDlAd" style="height:auto; font-size: 24px;">
    <table width="100%" height="203px" border="0">
  <tr>
    <td rowspan="2" width="32%" style="text-align:center"><img id="appPic" width="175px" height="182px"/></td>
    <td rowspan="2" width="42%">
    <div id="appNm" style="font-size:30px; margin:0px; margin-top:10px;">&nbsp;</div>
    <div style="margin-top:10px;">大小：<span id="size"></span></div>
    <div style="margin-top:10px;">下载：<span id="dlHistory"></span>次</div>
    <div style="margin-top:10px;">版本：<span id="edition"></span></div>
    </td>
    <td><div id="free" style="color:#0b77bb; font-size:28px; text-align:center; margin-top:50px"></div>
 <!--   <div id="free1" style="color:#0b77bb; font-size:28px; text-align:center; margin-top:10px">发生的发生</div>-->
    </td>
    
  </tr>
  <tr height="75px">
    <td style="text-align:center"><a  id="dlBtn" ><img src="res/img/download.png" /></a></td>
  </tr>
</table>

    </div>
    <div id="appDlAp" style="height:auto; font-size: 24px;">
    <table width="100%" height="203px" border="0">
  <tr>
    <td rowspan="2" width="32%" style="text-align:center"><img id="appPicAp" width="175px" height="182px"/></td>
    <td rowspan="2" width="42%">
    <p id="appNmAp" style="font-size:30px; margin:0px">&nbsp;</p>
    <p>大小：<span id="sizeAp"></span></p>
    <p>更新日期：<span id="releasedate"></span></p>
    <p>版本：<span id="editionAp"></span></p>
    </td>
    <td><p id="freeAp" style="color:#f35922; text-align:center"></p>
    <p style="text-align:center">来源：iTunes</p>
    </td>
  </tr>
  <tr height="75px">
    <td style="text-align:center"><img id="dlBtnAp" src="res/app/images/tj_download.png"/></td>
  </tr>
</table>

    </div>
    <div style="width:100%; height:1px; background-color:#CCC"></div>
    <div id="appInfo" style="padding-right: 20px; padding-bottom: 10px; font-size: 32px; height:auto">
    <div style="padding-left:10px; line-height:50px">官方介绍：</div>
    <div id="app_det" style="padding-left: 20px; font-size: 26px; line-height:40px; width:100%;" class="overflow"> </div>
    
    </div>
    <div id="openBtn" align="center" onClick="uporDown()"><img id="openFlag" src="res/app/images/tj_down.png"/><input id="updownFlag" type="hidden" value="0"/></div>
    <div style="height:1px; width:100%; background-color:#CCC"></div>
    <div id="appReco">
    <div style="margin-bottom: 10px; margin-top: 20px; font-size: 32px;">你可能还会喜欢：</div>
    <div id="app_reco"></div>
    </div>
    </div>
    <div id="content2"></div>
	<!-- InstanceEndEditable -->
    </div>
    <!-- InstanceBeginEditable name="EditRegion-footer" -->
	<!-- InstanceEndEditable -->
    <div id="footer">
    </div>
    
</body>
<!-- InstanceEnd --></html>
